
<template xmlns="">
    <WujieVue
        v-if="reloading"
        width="100%"
        height="100%"
        name="generator"
        :url="viewUrl"
        :sync="true"
        :props="props"
    >
    </Wujievue>
</template>


<script lang="ts">
export default {
  name: 'dataGenerator',
}
</script>

<script setup lang="ts">

import {onMounted, nextTick, ref, onBeforeMount, reactive} from 'vue';
import {queryParams} from "../../untils/tip";

// 主应用中
import { bus } from 'wujie';

const reloading = ref(false)
const viewUrl = ref()
const props = ref()

onBeforeMount(()=>{
  setSrc();
})


const setSrc = () => {
  reloading.value = false
  viewUrl.value = import.meta.env.VITE_GENERATOR_URL;
  props.value = reactive({
    isChildrenApp: true
  });

  // 使用nextTick确保DOM更新后再显示组件
  nextTick(() => {
    reloading.value = true;
  });
}


</script>


<style scoped>
.third-party-embed iframe {
  border: none;
  width: 100%;
  height: 500px;
}
</style>